<?php
abstract class abstract_app {

    protected $id;
    protected $registry;
    protected $config;

    protected $action;
    protected $error_action;
    protected $pre_action;


    public function __construct($registry, interface_config $config){
        $this->config = $config; 
        $this->registry = $registry;
        $this->pre_action = array();
    }

	public function __get($key) {
		return $this->registry->get($key);
	}
	
	public function __set($key, $value) {
		$this->registry->set($key, $value);
	}

    public function get_id(){
        return $id;
    }

    public function get_action(){
        return $this->action;
    }
    public function get_pre_action(){
        return $this->pre_action;
    }
    public function get_config(){
        return $this->config;
    }
    
    public function set_paths($paths) {
        $this->config->set_section('paths')
            ->set_all($paths);
    }

    public function set_path($resource, $path){
        $this->config->set_section('paths')
            ->set($resource, $path);
    }

    public function get_path($resource){
        return $this->config->set_section('paths')->get($resource);
    }
}

